qrisp.Operation.inverse#

Operation.inverse()[source]#

Returns the inverse of this Operation (if applicable).

Returns:
Operation

The daggered operation.

Raises:
Exception

Tried to invert non-unitary operation.

Examples

We invert a phase gate and inspect it’s parameters

>>> from qrisp import PGate
>>> phase_gate = PGate(0.8)
>>> phase_gate.inverse().params
[-0.8]